<template>
  <div class="create-table-module">
    <div>
      <StyleSetting ref="stySetting" title="表格样式配置" module="table"/>
      <el-form :model="dataForm" label-position="right" label-width="80px">
        <el-form-item label="模块宽度" size="small" prop="layoutNum" style="margin-top: 6px;">
          <el-select v-model="dataForm.layoutNum" class="width240" popper-class="global-select-down" name="layoutNum">
            <el-option
              v-for="item in layoutOptions"
              :key="item.id"
              :label="item.name"
              :value="item.value" />
          </el-select>
        </el-form-item>
      </el-form>
    </div>
  </div>
</template>

<script>
import Title from '@/components/Title';
import { layoutOptions } from '@/filters/status';
import StyleSetting from '@/components/ReportManage/chartCreate/commonStySetting/styleDiy';
export default {
  components: { Title, StyleSetting },
  model: {
    prop: 'dataForm',
    event: 'changeData'
  },
  props: {
    dataForm: {
      type: Object,
      default: () => ({})
    }
  },
  data() {
    return {
      layoutOptions
    };
  },
  methods: {
    setStyleDefault(data) {
      if (this.$refs.stySetting) {
        this.$refs.stySetting.setDefault(data);
      }
    },
    getData(extendParams = {}) {
      if (this.$refs.stySetting) {
        this.dataForm.styleConfig = this.$refs.stySetting.getStyle(extendParams);
      }
      this.changeData();
      return JSON.parse(JSON.stringify(this.dataForm));
    },
    changeData() {
      this.$emit('changeData', this.dataForm);
    }
  }
};
</script>

<style lang="scss" scoped>
.create-table-module {
  margin-top: 26px;
  padding-bottom: 50px;
  .one-cell {
    display: flex;
  }
}
.width240 {
  width: 240px;
  &::v-deep {
    .el-input__inner {
      width: 240px;
    }
  }
}
</style>
